<template>
  <el-col :span="24">
 <el-col :span="16"> <viewTitle text="基本信息" style="font-size:20px;" />
  </el-col>
              <el-col :span="6">
 <el-button type="primary" size="mini" @click="xiugai">维护信息</el-button>
  </el-col>

        <div class="separate" style="marginTop:20px;">
            <el-descriptions direction="horizontal" :column="8" size='small'  border>
          <el-descriptions-item label="姓名"> {{patientinfo2.name?patientinfo2.name:""}}</el-descriptions-item>
          <el-descriptions-item label="性别" >{{patientinfo2.gender?patientinfo2.gender:""}}</el-descriptions-item>
          <el-descriptions-item label="年龄">{{patientinfo2.age?patientinfo2.age:""}}岁</el-descriptions-item>
           <el-descriptions-item label="住院号">{{patientinfo2.ipt_no}}</el-descriptions-item>
          <el-descriptions-item label="床位">{{patientinfo2.room_infoname?patientinfo2.room_infoname:""}}</el-descriptions-item>
          <el-descriptions-item label="身份证">{{patientinfo2.id_card}}</el-descriptions-item>
          <!-- <el-descriptions-item label="陪护人">{{patientinfo2.family_name}}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="陪护人联系">{{patientinfo2.family_phone}}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="科室">{{patientinfo2.dept.name?patientinfo2.dept.name:""}}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="护理等级">{{patientinfo2.nurse_level_name?patientinfo2.nurse_level_name:""}}</el-descriptions-item> -->
         <!--  <el-descriptions-item label="风险等级">{{patientinfo2.risk_level}}</el-descriptions-item>
          <el-descriptions-item label="病人性质">{{patientinfo2.memberNature?patientinfo2.memberNature:""}}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="科室">{{user.deptName}}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="入院时间">{{patientinfo2.begntime}}</el-descriptions-item> -->
          <el-descriptions-item label="入院天数">{{patientinfo2.day}}</el-descriptions-item>
              <el-descriptions-item label="总花费">{{patientinfo2.wallet.balance}}</el-descriptions-item>
              <el-descriptions-item label="余额">{{patientinfo2.wallet.wallet_money}}</el-descriptions-item>
              <el-descriptions-item  label="今日费用">{{patientinfo2.today_money||0}}</el-descriptions-item>
              <el-descriptions-item label="今日药费">{{patientinfo2.drug_money||0}}</el-descriptions-item>

               <el-descriptions-item  label="总药占比">{{patientinfo2.drug_rate||0}}</el-descriptions-item>

                <el-descriptions-item label="今日药占比">{{patientinfo2.today_drug_rate||0}}</el-descriptions-item>
        <el-descriptions-item label="入院时间">{{patientinfo2.begntime}}</el-descriptions-item>
          <!-- <el-descriptions-item label="可用押金">{{patientinfo2.wallet.wallet_money}}</el-descriptions-item>
          <el-descriptions-item label="已交押金">{{patientinfo2.wallet.wallet_income }}</el-descriptions-item> -->
          <!-- <el-descriptions-item label="备注" :span="4">{{patientinfo2.adm_diag_dscr}}</el-descriptions-item> -->
       <!-- <el-descriptions-item label="入院诊断" :span="24">{{patientinfo2.diseaseName?patientinfo2.diseaseName:""}}</el-descriptions-item> -->

        </el-descriptions>

        </div>
            <el-dialog
      title="编辑患者信息"
      :visible.sync="listFlag"
      width="90%"
     >
      <span>
        <el-col :span="24">
          <el-form :inline="false" :model="listUser" label-width="110px" style="text-align:left;">
            <el-col :span="24" style="font-size:24px;margin:0px 0 10px 0;">
                基本信息
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="姓名:">
                  <el-input v-model="listUser.name" placeholder="请输入姓名" :disabled="listType == 1"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="性别:">
                  <el-select style="width:100%"  :disabled="listType == 1" v-model="listUser.gender" placeholder="请选择性别">
                    <el-option
                      v-for="item in sex"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="年龄:">
                  <el-input v-model="listUser.age" :disabled="listType == 1" placeholder="请输入年龄"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="婚姻状况:">
                  <el-select style="width:100%" v-model="listUser.marriage" :disabled="listType == 1" placeholder="请选择婚姻状况">
                    <el-option
                      v-for="item in marriage"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="血型:">
                  <el-select style="width:100%" v-model="listUser.blood_type" :disabled="listType == 1" placeholder="请选择婚姻状况">
                    <el-option
                      v-for="item in blood_type"
                      :key="item.value"
                      :label="item.label"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="国籍:">
                  <el-select v-model="listUser.country" :disabled="listType == 1" style="width:100%;" filterable placeholder="请输入可搜索国家">
                    <el-option
                      v-for="item in country"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="病人性质:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.nature" placeholder="请选择病人性质">
                    <el-option
                      v-for="item in nature"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="身份证号码:">
                   <el-input v-model="listUser.id_card" :disabled="listType == 1" placeholder="请输入身份找号码"></el-input>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">

              <el-col :span="6">
                <el-form-item label="出生日期:">
                  <el-date-picker
                      style="width:100%;"
                      v-model="listUser.birthday"
                      type="date"
                      :disabled="listType == 1"
                      placeholder="选择生日">
                    </el-date-picker>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="民族:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.nation" filterable placeholder="请选择民族">
                    <el-option
                      v-for="item in nation"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="媒介来源:">
                    <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.source" filterable placeholder="请选择媒介来源">
                    <el-option
                      v-for="item in source"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24" style="font-size:24px;margin:0px 0 10px 0;">
              补充信息
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="籍贯:">
                  <el-input v-model="listUser.native_place" :disabled="listType == 1" placeholder="请输入籍贯"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="移动电话:">
                  <el-input v-model="listUser.phone" :disabled="listType == 1" placeholder="请输入移动电话"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="紧急联系电话:">
                  <el-input v-model="listUser.fast_phone" :disabled="listType == 1" placeholder="请输入紧急联系电话"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="户籍地址:">
                  <el-input v-model="listUser.home_address" :disabled="listType == 1" placeholder="请输入户籍地址"></el-input>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="职业:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.post" placeholder="请选择职业">
                    <el-option
                      v-for="item in post"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="工作单位:">
                   <el-input v-model="listUser.company" :disabled="listType == 1" placeholder="请输入工作单位"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="证件类型:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.card_type" placeholder="请选择证件类型">
                    <el-option
                      v-for="item in card_type"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="证件号码:">
                   <el-input v-model="listUser.card_number" :disabled="listType == 1" placeholder="请输入证件号码"></el-input>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="密级:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.secret_level" placeholder="请选择密级">
                    <el-option
                      v-for="item in secret_level"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="学历:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.edu_level" placeholder="请选择学历">
                    <el-option
                      v-for="item in edu_level"
                      :key="item.id"
                      :label="item.name"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="生育状态:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.birth_status" placeholder="请选择生育状态">
                    <el-option
                      v-for="item in birth_status"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="保险类型:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.insurance_no" placeholder="请选择保险类型">
                    <el-option
                      v-for="item in insurance_no"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-col :span="6">
                <el-form-item label="社会保障号:">
                  <el-input v-model="listUser.social_card" :disabled="listType == 1" placeholder="请输入社会保障号"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="6">
                <el-form-item label="是否异地:">
                  <el-select style="width:100%" :disabled="listType == 1" v-model="listUser.is_nolocal" placeholder="请选择是否异地">
                    <el-option
                      v-for="item in is_nolocal"
                      :key="item.value"
                      :label="item.name"
                      :value="item.value">
                    </el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="24">
                <el-form-item label="备注:">
                  <el-input type="textarea" :disabled="listType == 1" v-model="listUser.extra_json" placeholder="请输入备注"></el-input>
                </el-form-item>
              </el-col>
            </el-col>
            <el-col :span="24">
              <el-form-item label="照片:">
                <el-upload
                  class="avatar-uploader"

                  :disabled="listType == 1"
                  :action="http + '/upload/image'"
                  :show-file-list="false"
                  :on-success="handleAvatarSuccess"
                  :before-upload="beforeAvatarUpload">
                  <img v-if="imageUrl" :src="imageUrl" class="avatar">
                  <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                </el-upload>
              </el-form-item>
            </el-col>
            <el-col :span="24">
              <el-col :span="24" v-for="(item,key) in listUser.family" :key="key">
                <el-col :span="24" style="font-size:24px;margin:0px 0 10px 0;">
                  家庭成员{{key+1}}
                </el-col>
                <el-col :span="24">
                    <el-col :span="7">
                      <el-form-item label="名字:">
                        <el-input v-model="item.name" :disabled="listType == 1" placeholder="请输入家庭成员名字"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7">
                      <el-form-item label="手机号:">
                        <el-input v-model="item.phone" :disabled="listType == 1" placeholder="请输入家庭成员手机号"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7">
                      <el-form-item label="家庭成员性别:">
                          <el-select style="width:100%" :disabled="listType == 1" v-model="item.gender" placeholder="请选择家庭成员性别">
                            <el-option
                              v-for="item in sex"
                              :key="item.value"
                              :label="item.label"
                              :value="item.value">
                            </el-option>
                          </el-select>
                      </el-form-item>
                    </el-col>
                </el-col>
                <el-col :span="24">
                    <el-col :span="7">
                      <el-form-item label="家庭成员生日:">
                      <el-date-picker
                          style="width:100%;"
                          :disabled="listType == 1"
                          v-model="item.birthday"
                          type="date"
                          placeholder="选择生日">
                        </el-date-picker>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7">
                      <el-form-item label="家庭成员关系:">
                        <el-input v-model="item.relation" :disabled="listType == 1" placeholder="请输入家庭成员关系"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="7">
                      <el-form-item label="家庭成员地址:">
                        <el-input v-model="item.address" :disabled="listType == 1" placeholder="请输入家庭成员地址"></el-input>
                      </el-form-item>
                    </el-col>
                    <el-col :span="2" :offset="1">
                        <el-button type="primary" :disabled="listType == 1" @click="handleDeleteFamily(key)">删除成员</el-button>
                    </el-col>
                </el-col>
              </el-col>
              <el-col :span="24">
                <el-col :span="6">
                  <el-form-item label="添加家庭成员:">
                    <el-button type="primary" :disabled="listType == 1" @click="handleAddFamily">添加成员</el-button>
                  </el-form-item>
                </el-col>
              </el-col>
            </el-col>
          </el-form>
        </el-col>
      </span>
      <span slot="footer" class="dialog-footer">
        <el-button @click="listFlag = false">取 消</el-button>
        <el-button type="primary" @click="addSave()">确 定</el-button>
      </span>
    </el-dialog>
  </el-col>
</template>

<script>

import ViewTitle from "@/forComponents/viewTitle";
import {getMemberIndex,addSave,getProfileInfo,getSetStatus} from "@/api/patient"
import {readHospitalMemberDetail,getNurseLevel} from "@/api/zhuyanre"
import { getdictIndex } from "@/api/register";
import {http} from "@/utils/server"
import {objectValueAllEmpty} from "@/utils/ifObject"
export default {
  name:"costsRecord",
  props: ["id"],
  data(){
    return {
     yinshi:[],
     huli:[],
     listType:3,
       http:http,
     patientinfo2:{

       nurse_levelneme: "",
        member: {
          name: "",
          gender: "",
          age: ""
        },
        wallet: {
          wallet_income: ""
        },
       today_cash:{
         drug_money:"0.00",
         today_money:"0"
       },
        doctor: { real_name: "" },
        nurse: { real_name: "" },
        room_name: "",
        dept:{name:''},

     },
           secret_level:[
        {
          value:1,
          name:"普通"
        },
        {
          value:2,
          name:"机密"
        },
         {
          value:3,
          name:"绝密"
        }
      ],
     listFlag:false,
         listUser:{
        name:"", //姓名
        id_card:"", //身份证号
        gender:"", //性别
        age:"", //年龄
        phone:"", //手机号
        birthday:"", //生日
        marriage:"", //婚姻状态   1未知 2未婚 3已婚 4离异 5丧偶
        blood_type:"", //血型  @1 A型 @2 B型 @3 O型 @4 AB型 @5 未知
        rh_blood_type:"", //rh血型 @1阴性 @2 阳性  @3 未知
        country:"CHN", //国家， 字典id 33，这里需要的是字典的name值
        nation:"", //民族 字典id 37，这里需要的是字典的name值
        address	:"", // 住址
        social_card:"", //社保卡号
        source:"", //媒介来源 40
        nature:"", //病人性质: 读取数据字典   4 取字典的id 值
        post:"", //职业
        company:"", //所在单位
        email:"", //邮箱
        native_place:"", //籍贯
        zip_code:"", //邮编
        tel:"", //家庭电话
        card_type:"",// 证件类型  : 读取数据字典   25 取字典的id 值
        card_number:"", //证件号码
        secret_level:"", //密级 @1 普通 @2 机密@3 绝密
        home_address:"", //户籍地址
        edu_level:"", //学历  数据字典为 39，取值为name
        birth_status:"", //生育状态 @1 未育 @2 已育
        is_nolocal:"", //是否外地  @1 是  @2 否
        avatar:"", //照片地址
        fast_name:"", //紧急联系人
        fast_phone:"", //联系人手机号
        insurance_no:"", //保险类型
        family:[
         {
           name:"", //家庭成员姓名
           phone:"", //家庭成员手机号
           gender:"", //家庭成员性别
           birthday:"", //家庭成员生日
           relation:"", //家庭成员关系
           address:"", //家庭成员地址
         }
        ]
      },
      sex:[
        {
          value:1,
          label: '男'
        }, {
          value:2,
          label: '女'
        }
      ],
      marriage:[
        {
          value:1,
          label: '未知'
        },
        {
          value:2,
          label: '未婚'
        },
         {
          value:3,
          label: '已婚'
        },
         {
          value:4,
          label: '离异'
        },
         {
          value:5,
          label: '丧偶'
        }
      ],
      blood_type:[  //血型select
        {
          value:1,
          label: 'A型'
        },
        {
          value:2,
          label: 'B型'
        },
         {
          value:3,
          label: 'O型'
        },
         {
          value: '4',
          label: 'AB型'
        },
         {
          value: '5',
          label: '未知'
        }
      ],
      rh_blood_type:[ //RH血型select
        {
          value:1,
          label: '阴性'
        },
        {
          value:2,
          label: '阳性'
        },
         {
          value:3,
          label: '未知'
        }
      ],
      birth_status:[  //生育状态
        {
          value:1,
          label: '未育'
        },
        {
          value:2,
          label: '已育'
        }
      ],
      is_nolocal:[ //是否外地select
        {
          value:1,
          label: '是'
        },
        {
          value:2,
          label: '否'
        }
      ],
     nature:[],
      country:[],
      post:[],
      card_type:[],
      edu_level:[],
      insurance_no:[],
      nation:[],
      source:[],
      listUser:[],
      imageUrl:''
    }
  },
   watch: {
    //  console.log( this.userdata,'000000')
    id(n) {
         this.readHospitalMemberDetail(n)
    }},
  mounted(){
    this.getdictIndex()
    this.getNurseLevel()
    if(this.id){
         this.readHospitalMemberDetail(this.id)
    }
   this.handleDictIndex()
  },
  methods:{
    xiugai(){
          this.getProfileInfo(this.patientinfo2.id_card)
       this.listFlag = true
    },
       handleDeleteFamily(key){
         var that=this
     that.listUser.family.splice(key,1)
   },
       handleAddFamily(){
         var that=this
    that.listUser.family.push(
      {
        name:"", //家庭成员姓名
        phone:"", //家庭成员手机号
        gender:"", //家庭成员性别
        birthday:"", //家庭成员生日
        relation:"", //家庭成员关系
        address:"", //家庭成员http地址
      }
    )
   },
    addSave(){
    let data = {
      name:"",
      id_card:"",
      gender:""
    }
    var that=this
    let list = {

    }
    Object.keys(data).forEach(key=>{
      data[key] = that.listUser[key]
    })
    Object.keys(that.listUser).forEach((item,key)=>{
      if(item != "get_family"){
        list[item] = that.listUser[item]
      }
    })
    that.listUser = list
    if(!objectValueAllEmpty(data)){
      this.$message({
          message:"请认真填写表单信息",
          type: 'error'
        });
      return false
    }
    addSave({...that.listUser})
    .then(res=>{
      that.$message({
        message:res.message,
        type: 'success'
      });
      that.listUser = that.$options.data.call(this).listUser
      that.listFlag = false
      that.getMemberIndex()
    })
    .catch(e=>{
      that.$message({
        message:e.message,
        type: 'error'
      });
    })
   },
       getProfileInfo(e){
         var that=this
     getProfileInfo({id_card:e})
     .then(res=>{
       res.data.family = res.data.get_family
      //  that.handleDictIndex()
       res.data.edu_level = parseFloat(res.data.edu_level)
       that.listUser = res.data
     })
     .catch(e=>{
       that.$message({
        message:e.message,
        type: 'error'
      });
     })
   },
        getNurseLevel() {
      getNurseLevel({}).then(res => {
        this.huli = res.data;
      });
    },
      handleDictIndex(){
        var that=this
     getdictIndex({group_id:"33,4,22,25,39,13,37,40"})
     .then(res=>{
       console.log(res)
       if(res.data.length != 0){
         res.data.forEach(item=>{
           switch(item.id){
             case 4:
              that.nature = item.items
             break
             case 33:
              that.country = item.items
             break
             case 22:
              that.post = item.items
             break
             case 25:
              that.card_type = item.items
             break
             case 39:
              that.edu_level = item.items
             break
             case 13:
              that.insurance_no = item.items
             break
             case 37:
              that.nation = item.items
             break
             case 40:
              that.source = item.items
             break
           }
         })
       }
     })
     .catch(e=>{
      this.$message({
        message:e.message,
        type: 'error'
      });
     })
   },
     handleAvatarSuccess(res,file){
      that.imageUrl = URL.createObjectURL(file.raw);
      that.listUser.avatar = res.data.url
   },
   //限制图片
   beforeAvatarUpload(file) {
        const isJPG = file.type === 'image/jpeg';
        const isLt2M = file.size / 1024 / 1024 < 2;

        if (!isJPG) {
          this.$message.error('上传头像图片只能是 JPG 格式!');
        }
        if (!isLt2M) {
          this.$message.error('上传头像图片大小不能超过 2MB!');
        }
        return isJPG && isLt2M;
   },
    getdictIndex(){
          getdictIndex({ group_id: '4,6' }).then(res => {
            let data = res.data;
          data.forEach((item, key) => {
            if(item.id==6){

             this.yinshi=item.items;
            }else if (item.id==4) {
              this.member_lv=item.items;
            }
          });
      });
    },

      readHospitalMemberDetail(id){
        readHospitalMemberDetail({id:id}).then(res=>{
           
             var objdata={
               drug_rate:res.data.drug_rate,
               today_drug_rate:res.data.today_drug_rate,
             }
        Object.assign(objdata, res.data.masterInfo, res.data.nodeInfo,res.data.member,res.data.today_cash);
        
        this.patientinfo2=objdata
        this.patientinfo2.room_infoname=''
        if( this.patientinfo2.room_info){
              this.patientinfo2.room_info=objdata.room_name.split('/')
              this.patientinfo2.room_infoname=this.patientinfo2.room_info[3]
        }

             this.patientinfo2.gender =
                this.patientinfo2.gender == 1
                  ? "男"
                  : this.patientinfo2.gender == 2
                  ? "女"
                  : "其他";
              // this.patientinfo2.nurse_levelneme = this.mapping(
              //   this.patientinfo2.nurse_level
              // );
               this.patientinfo2.diet_id = this.mapxing(
                this.patientinfo2.diet_id
              );

               this.patientinfo2.memberNature=this.mapyin(
                 this.patientinfo2.nature
               )
               if (this.patientinfo2.disease) {
                          this.patientinfo2.diseaseName =  this.patientinfo2.disease.map(item=>{
              return item.disease_name
            })
             this.patientinfo2.diseaseName =  this.patientinfo2.diseaseName.join("&")
               }
               console.log('patientinfo2',this.patientinfo2)
        })
      },
      mapping(num) {

      var art = "";
      for (var i in this.huli) {
        if (this.huli[i].id == num) {

          art = this.huli[i].name;
        }
        return art;
      }
    },

     mapxing(num) {

      var art = "";
      for (var i in this.yinshi) {
        if (this.yinshi[i].id == num) {

          art = this.yinshi[i].name;
        }
        return art;
      }
    },
        //匹配斌人性质
     mapyin(num) {

      var art = "";
      for (var i in this.member_lv) {
        if (this.member_lv[i].id == num) {

          art = this.member_lv[i].name;
        }
        return art;
      }
    },

  },
  components:{

    ViewTitle,

  }
}
</script>

<style lang='scss' scoped>

.separate {
    .dialog-text {
        font-size: 16px;
        margin-bottom: 16px;
        display: flex;
        justify-content: space-between;
        span{
          display: inline-block;

          text-indent:1em
        }
    }
}
.el-descriptions .is-bordered .el-descriptions-item__cell{
      border: 1px solid #EBEEF5;
      padding: 2px 0px;

}
</style>
